import Vue from 'vue';
import Router from 'vue-router';
import Service from '@/app/service';
import ServiceCharter from '@/app/service/center/content/charter';
import ServiceHabit from '@/app/service/center/content/habit';
import ServiceMonitor from '@/app/service/center/content/monitor';
import ServiceTopic from '@/app/service/center/content/topic';
import Account from '@/app/account';
import AccountSecurity from '@/app/account/security';
import AccountSecurityLogin from '@/app/account/security/center/login';
import AccountSecurityLogout from '@/app/account/security/center/logout';
import AccoutSecuritySignup from '@/app/account/security/center/signup';
import ToolBox from '@/app/toolbox';
import ToolBoxXmap from '@/app/toolbox/xmap';

Vue.use(Router);

export default new Router({
  mode: 'history',
  routes: [{
    path: '/',
    redirect: '/service/charter',
  }, {
    path: '/service',
    name: 'app-service',
    component: Service,
    children: [{
      path: 'charter',
      name: 'app-service-charter',
      component: ServiceCharter,
    }, {
      path: 'habit',
      name: 'app-service-habit',
      component: ServiceHabit,
    }, {
      path: 'monitor',
      name: 'app-service-monitor',
      component: ServiceMonitor,
    }, {
      path: 'topic',
      name: 'app-service-topic',
      component: ServiceTopic,
    }],
  }, {
    path: '/account',
    name: 'app-account',
    component: Account,
    children: [{
      path: 'security',
      name: 'app-account-security',
      component: AccountSecurity,
      children: [{
        path: 'login',
        name: 'app-account-security-login',
        component: AccountSecurityLogin,
      }, {
        path: 'logout',
        name: 'app-account-security-logout',
        component: AccountSecurityLogout,
      }, {
        path: 'signup',
        name: 'app-account-security-signup',
        component: AccoutSecuritySignup,
      }],
    }],
  }, {
    path: '/toolbox',
    name: 'app-toolbox',
    component: ToolBox,
    children: [{
      path: 'xmap/:type/:id',
      name: 'app-toolbox-xmap',
      component: ToolBoxXmap,
    }],
  }],
});
